package com.jv.controller;

import com.jv.domain.Users;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/service2")
public class WebController {
    @RequestMapping("/getMsg")
    @ResponseBody
    public String getMsg(HttpSession session) {
        String msg = (String) session.getAttribute("msg");
        return  msg;
    }
    @RequestMapping("/getUsers")
    @ResponseBody
    public Users getUsers(HttpSession session) {
        Users users = (Users) session.getAttribute("u");
        return users;
    }
}
